package org.eclipse.ea.requisit.manager.utils;

import java.io.InputStream;
import java.io.Reader;
import java.io.Writer;

import org.eclipse.ea.requisit.manager.utils.log.Level;
import org.eclipse.ea.requisit.manager.utils.log.Log;

public class FileUtils {
	
	/**
	 * 
	 * @param writer
	 */
	public static void closeWriter(Writer writer){
		
		try{
			writer.close();
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	
	/**
	 * 
	 * @param reader
	 */
	public static void closeReader(Reader reader){
		try{
			reader.close();
		}catch(Exception e){
			Log.logMessage(e, Level.Erro, FileUtils.class);
		}
	}
	
	public static void closeInputStream(InputStream stream) {
		try{
			if(stream != null){
				stream.close();
			}
		}catch(Exception e){
			Log.logMessage(e, Level.Erro, FileUtils.class);
		}
	}

}
